<div class="container">
    <h2>Admin Product</h2> 
	<div class="row">
    <div>
	<div class="form-group">
	 <div class="col-lg-6">
        <form action="<?php echo URL; ?>adminProducts/addProduct" method="POST" enctype="multipart/form-data" >
            <div class="form-group">
				<label>product_name_ar</label>
                <input type="text" name="product_name_ar" value="" class="form-control" />
            </div>
             <div class="form-group">
				<label>product_name_en</label>
                <input type="text" name="product_name_en" value="" class="form-control" />
            </div>
	        
            <div class="form-group">
				<label>product_description_ar</label>
                <input type="text" name="product_description_ar" value="" class="form-control" />
            </div>
            
			 <div class="form-group">
				<label>product_description_en</label>
                <input type="text" name="product_description_en" value="" class="form-control" />
            </div>
			<div class="form-group">
				<label>image</label>
                <input type="text" name="image" value="" class="form-control" />
            </div>
			<div class="form-group">
				<label>minprice</label>
                <input type="text" name="minprice" value="" class="form-control" />
            </div>
			<div class="form-group">
				<label>maxprice</label>
                <input type="text" name="maxprice" value="" class="form-control" />
            </div>
			<div class="form-group">
				<label>colour</label>
                <input type="text" name="colour" value="" class="form-control" />
            </div>
			<div class="form-group">
				<label>image</label>
                <input type="text" name="image" value="" class="form-control" />
            </div>
						
            <div class="form-group">
				<label>weight</label>
                <input type="text" name="weight" value="" class="form-control" />
            </div>
            
            <div class="form-group">
				<label>size</label>
                <input type="text" name="size" value="" class="form-control" />
            </div>
            
            <div class="form-group">
				<label>legnth</label>
                <input type="text" name="legnth" value="" class="form-control" />
            </div>
			<div class="form-group">
				<label>weidth</label>
                <input type="text" name="weidth" value="" class="form-control" />
            </div>
			<div class="form-group">
				<label>minnumber</label>
                <input type="text" name="minnumber" value="" class="form-control" />
            </div>
			<div class="form-group">
				<label>maxnumber</label>
                <input type="text" name="maxnumber" value="" class="form-control" />
            </div>
			<div class="form-group">
				<label>type</label>
                <input type="text" name="type" value="" class="form-control" />
            </div>
			<div class="form-group">
				<label>type</label>
                <input type="text" name="type" value="" class="form-control" />
            </div>
			<div class="form-group">
				<label>historical_description_ar</label>
                <input type="text" name="historical_description_ar" value="" class="form-control" />
            </div>
			<div class="form-group">
				<label>historical_description_en</label>
                <input type="text" name="historical_description_en" value="" class="form-control" />
            </div>
			
			 <div class="form-group">
			    <label>Category</label>
			    <select class="form-control" name="category_id">
			        <?php 
					foreach( $categories as $category )
					{
					?>
					<option value="<?php print $category->category_id;?>"><?php print $category->name_en;?></option>
					<?php 
					}
					?>
			    </select>
			</div>
			<div class="form-group">
			    <label>digital content</label>
			    <select class="form-control" name="digital_content_id">
			        <?php 
					foreach( $digital_contents as 	$digital_content )
					{
					?>
					<option value="<?php print 	$digital_content->digital_content_id;?>"><?php print  $digital_content->title_en;?></option>
					<?php 
					}
					?>
			    </select>
			</div>
		<div class="form-group">
				<label>Upload Image</label>
                <input type="file" name="image">
            </div>	
			<div class="form-group">
				<button name="submit_add_Product" type="submit"  value="Submit" class="btn btn-default">Add Product Item</button>
			</div>
     </div>
    			
			
     </form>
</div>
        
			
			
       
    
	
    <!-- main content output -->
    <div>
        
       
        
     <div class="row">
	<div class="col-lg-12">
	<h3>List of products (data from first model)</h3>
           <div class="table-responsive">
			<table class="table table-bordered table-hover table-striped">
				<thead>
					<tr>
		        <td>product_id</td>
				<td>product_name_ar</td>
				<td>product_description_ar</td>
				<td>product_name_en</td>
                <td>product_description_en</td>
                <td>image</td>
                <td>minprice</td>
                <td>maxprice</td>
                <td>colour</td>
                <td>weight</td>
				<td>size</td>
				<td>legnth</td>
				<td>weidth</td>
				<td>minnumber</td>
				<td>maxnumber</td>
				<td>type</td>
				<td>type</td>
				<td>Historical Description_ar</td>
				<td>Historical Description_en</td>				
				<td>Votes</td>	
                <td>status<td/>				
				<td>Delete</td>
				<td>Edit</td>
				
           </tr>
           </thead>
           <tbody>
            <?php foreach ($products as $product) {

			?>
                <tr>
                    <td><?php if (isset($product->product_id)) echo htmlspecialchars($product->product_id, ENT_QUOTES, 'UTF-8'); ?></td>
					<td><?php if (isset($product->product_name_ar)) echo htmlspecialchars($product->product_name_ar, ENT_QUOTES, 'UTF-8'); ?></td>
                    <td><?php if (isset($product->product_description_ar)) echo htmlspecialchars($product->product_description_ar, ENT_QUOTES, 'UTF-8'); ?></td>
                    <td><?php if (isset($product->product_name_en)) echo htmlspecialchars($product->product_name_en, ENT_QUOTES, 'UTF-8'); ?></td>
                    <td><?php if (isset($product->product_description_en)) echo htmlspecialchars($product->product_description_en, ENT_QUOTES, 'UTF-8'); ?></td>
                    <td><?php if (isset($product->image)) echo htmlspecialchars($product->image, ENT_QUOTES, 'UTF-8'); ?></td>
                    <td><?php if (isset($product->minprice)) echo htmlspecialchars($product->minprice, ENT_QUOTES, 'UTF-8'); ?></td>
					<td><?php if (isset($product->maxprice)) echo htmlspecialchars($product->maxprice, ENT_QUOTES, 'UTF-8'); ?></td>
                    <td><?php if (isset($product->colour)) echo htmlspecialchars($product->colour, ENT_QUOTES, 'UTF-8'); ?></td>
                    <td><?php if (isset($product->weight)) echo htmlspecialchars($product->weight, ENT_QUOTES, 'UTF-8'); ?></td>
                    <td><?php if (isset($product->size)) echo htmlspecialchars($product->size, ENT_QUOTES, 'UTF-8'); ?></td>
                    <td><?php if (isset($product->legnth)) echo htmlspecialchars($product->legnth, ENT_QUOTES, 'UTF-8'); ?></td>
                    <td><?php if (isset($product->weidth)) echo htmlspecialchars($product->weidth, ENT_QUOTES, 'UTF-8'); ?></td>
                    <td><?php if (isset($product->minnumber)) echo htmlspecialchars($product->minnumber, ENT_QUOTES, 'UTF-8'); ?></td>
					<td><?php if (isset($product->minnumber)) echo htmlspecialchars($product->maxnumber, ENT_QUOTES, 'UTF-8'); ?></td>
                    <td><?php if (isset($product->type_ar)) echo htmlspecialchars($product->type_ar, ENT_QUOTES, 'UTF-8'); ?></td>
					<td><?php if (isset($product->type_en)) echo htmlspecialchars($product->type_en, ENT_QUOTES, 'UTF-8'); ?></td>
                    <td><?php if (isset($product->historical_description_ar)) echo htmlspecialchars($product->historical_description_ar, ENT_QUOTES, 'UTF-8'); ?></td>
					<td><?php if (isset($product->historical_description_en)) echo htmlspecialchars($product->historical_description_en, ENT_QUOTES, 'UTF-8'); ?></td>
                    <td><?php if (isset($product->votes_count)) echo htmlspecialchars($product->votes_count, ENT_QUOTES, 'UTF-8'); ?></td>
					<td><?php if (isset($product->status)) echo htmlspecialchars($product->status, ENT_QUOTES, 'UTF-8'); ?></td>
					<td><a href="<?php echo URL . 'adminProducts/deleteProduct/' . htmlspecialchars($product->product_id, ENT_QUOTES, 'UTF-8'); ?>">delete</a></td>
                    <td><a href="<?php echo URL . 'adminProducts/editProduct/' . htmlspecialchars($product->product_id, ENT_QUOTES, 'UTF-8'); ?>">edit</a></td>
			   </tr>
            <?php } ?>
            </tbody>
          </table>
    </div>
	</div></div>
</div>
</div>
